﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace OOAD_Project_Engine.Foundation
{
    class UnitHelper
    {
        public static Vector2 ToVector2(float x, float y)
        {
            return new Vector2(x, y);
        }

        public static Vector2 ToVector2(Point point)
        {
            return new Vector2(point.X, point.Y);
        }

        public static float Distance(Vector2 v1, Vector2 v2)
        {
            return Vector2.Distance(v1, v2);
        }

        static public Vector2 GetRotationVector(Vector2 vector, float theta)
        {
            Vector2 res;
            res.X = (float)(vector.X * Math.Cos(theta) - vector.Y * Math.Sin(theta));
            res.Y = (float)(vector.X * Math.Sin(theta) + vector.Y * Math.Cos(theta));
            return res;
        }

        static public float ToRadians(float degrees)
        {
            return MathHelper.ToRadians(degrees);
        }

        static public float ToDegrees(float radians)
        {
            return MathHelper.ToDegrees(radians);
        }
    }
}
